AMD/IOMMU: return old PTE from {set,clear}_iommu_pte_present()
authorJan Beulich <jbeulich@suse.com>
Fri, 20 May 2022 10:24:43 +0000 (12:24 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 20 May 2022 10:24:43 +0000 (12:24 +0200)
commitec0cce125b8b9fccde3fa825b8ee963083b5de3b
tree1caef2b97359c0bac3d963b5a665edc4a7033cd9
parent0e461c2d7f45c50fcf4d26c7730cdd7cde77eb1f
AMD/IOMMU: return old PTE from {set,clear}_iommu_pte_present()

In order to free intermediate page tables when replacing smaller
mappings by a single larger one callers will need to know the full PTE.
Flush indicators can be derived from this in the callers (and outside
the locked regions). First split set_iommu_pte_present() from
set_iommu_ptes_present(): Only the former needs to return the old PTE,
while the latter (like also set_iommu_pde_present()) doesn't even need
to return flush indicators. Then change return types/values and callers
accordingly.

Note that for subsequent changes returning merely a boolean (old.pr) is
not going to be sufficient; the next_level field will also be required.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/drivers/passthrough/amd/iommu_map.c